/*
    IntersectAlignments.h

    Copyright (C) 2012 Leonardo Boquillon and Daniel Gutson, FuDePAN

    This file is part of Biorinox.

    Biorinox is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    Biorinox is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.

*/

#ifndef INTERSECT_ALIGNMENTS
#define INTERSECT_ALIGNMENTS

#include <string>

#include "bio-tmp.h"
#include "biopp-filer/bioppFiler.h"

class IntersectAlignments
{
public:

    typedef FullSequence Sequence;

    IntersectAlignments(const std::string&, const std::string&, const std::string&, const std::string&, const std::string&, const std::string&);
    void run();

private:
    const std::string inputFasta1;
    const std::string inputFasta2;
    const std::string outputFasta1;
    const std::string outputFasta2;
    const std::string prefix1;
    const std::string prefix2;

    static std::string removePrefix(std::string fullName, const std::string& prefix);
    static void loadNames(const std::string& fileName, std::set<std::string>& setSequence, const std::string& prefix);
    static void saveIntersection(const std::string& fastaInput, const std::string& fastaOutput, std::set<std::string> & intersectionSet, const std::string& prefix);

};

#endif
